package month4.day19;

import java.util.Scanner;

public class FirmMapText {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        FirmMap f = new FirmMap("111", "111", "111", "111");
        while (true) {
            System.out.println("1：招聘员工，2：输出员工信息，3：辞退员工，4：公司人数，5：公司薪水最高的员工，6：退出");
            int num = in.nextInt();
            if (num == 1) {
                System.out.println("输入员工姓名");
                String na = in.next();
                System.out.println("输入员工年龄");
                int age = in.nextInt();
                System.out.println("输入员工性别");
                String sex = in.next();
                System.out.println("输入员工职务");
                String duty = in.next();
                System.out.println("输入员工薪水");
                int money = in.nextInt();
                System.out.println("输入员工工号");
                String number = in.next();
                Staff s = new Staff(na, age, sex, duty, money, number);
                if (f.add(number,s))
                    System.out.println("添加成功");
                else
                    System.out.println("添加失败");
            } else if (num == 2) {
                f.show();
            } else if (num == 3) {
                System.out.println("输入辞退员工工号");
                String number = in.next();
                if (f.refuse(number))
                    System.out.println("删除成功");
                else
                    System.out.println("没有此员工");
            } else if (num == 4) {
                System.out.println("公司员工数量：" + f.count());
            } else if (num == 5) {
                System.out.println("公司薪水最高的员工：");
                if (f.staff() != null)
                    f.staff().show();
                else
                    System.out.println("公司暂时没有员工");
            } else if (num == 6) {
                break;
            }
        }
    }
}
